//
//  ExamArrangementCell.m
//  CoachsBook
//
//  Created by huiyong li on 2022/8/22.
//

#import "ExamArrangementCell.h"

@interface ExamArrangementCell()

@property(nonatomic,strong) UIView *bjview;
@property(nonatomic,strong) UILabel *examTimeLabel;  //考试时间
@property(nonatomic,strong) UILabel *examSujectLabel;   //考试科目
@property(nonatomic,strong) UILabel *examPersonnelLabel;    //考试人员
@property(nonatomic,strong) UILabel *examinationRoomLabel;    //考场



@end

@implementation ExamArrangementCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

{
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])
    {
        [self setupUI];
        self.contentView.backgroundColor = rgba(255, 255, 255, 1);
    }
    return self;
}

- (void)setupUI
{
    self.bjview = [[UIView alloc]initWithFrame:CGRectMake(16, 0, APPwidth-32, 205)];
    self.bjview.backgroundColor = rgba(245, 245, 250, 1);
    self.bjview.layer.cornerRadius = 8;
    self.bjview.layer.masksToBounds = YES;
    [self.contentView addSubview:self.bjview];
    
    
    
    self.examTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 10, APPwidth-62, 26)];
    self.examTimeLabel.font = kPingFangSemibold(16);
    self.examTimeLabel.textColor = rgba(51, 51, 51, 1);
    self.examTimeLabel.text = @"考试时间: 2022-07-28";
    [self.bjview addSubview:self.examTimeLabel];
    
    
    self.examSujectLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.examTimeLabel.frame)+6, APPwidth-62-65, 26)];
    self.examSujectLabel.font = kPingFangRegular(14);
    self.examSujectLabel.textColor = rgba(51, 51, 51, 1);
    self.examSujectLabel.text = @"约考科目: 科目二";
    [self.bjview addSubview:self.examSujectLabel];
    
    NSMutableAttributedString *examSujectstr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"约考科目: 科目二"]];
    [examSujectstr addAttribute:NSForegroundColorAttributeName value:rgba(120, 120, 120, 1) range:NSMakeRange(0,5)];
    self.examSujectLabel.attributedText = examSujectstr;
    
    
    self.examPersonnelLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.examSujectLabel.frame)+6, APPwidth-62, 26)];
    self.examPersonnelLabel.font = kPingFangRegular(14);
    self.examPersonnelLabel.textColor = rgba(51, 51, 51, 1);
    self.examPersonnelLabel.text = @"考试人员: 张三  李四  王二";
    [self.bjview addSubview:self.examPersonnelLabel];
    
    NSMutableAttributedString *examPersonnelstr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"考试人员: 张三  李四  王二"]];
    [examPersonnelstr addAttribute:NSForegroundColorAttributeName value:rgba(120, 120, 120, 1) range:NSMakeRange(0,5)];
    self.examPersonnelLabel.attributedText = examPersonnelstr;
    
    
    
    self.examinationRoomLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.examPersonnelLabel.frame)+6, APPwidth-62, 26)];
    self.examinationRoomLabel.font = kPingFangRegular(14);
    self.examinationRoomLabel.textColor = rgba(51, 51, 51, 1);
    self.examinationRoomLabel.text = @"考场名称: 长沙支队安沙科目一分考场";
    [self.bjview addSubview:self.examinationRoomLabel];
    
    NSMutableAttributedString *examinationRoomstr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"考场名称: 长沙支队安沙科目一分考场"]];
    [examinationRoomstr addAttribute:NSForegroundColorAttributeName value:rgba(120, 120, 120, 1) range:NSMakeRange(0,5)];
    self.examinationRoomLabel.attributedText = examinationRoomstr;
    
    
    self.messageBut = [[UIButton alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.examinationRoomLabel.frame)+20, (APPwidth-82)/2, 40)];
    [self.messageBut setTitle:@"短信通知" forState:UIControlStateNormal];
    [self.messageBut setTitleColor:rgba(22, 120, 255, 1) forState:UIControlStateNormal];
    self.messageBut.backgroundColor = [UIColor whiteColor];
    self.messageBut.titleLabel.font = kPingFangRegular(14);
    self.messageBut.layer.cornerRadius = 20;
    self.messageBut.layer.masksToBounds = YES;
    self.messageBut.layer.borderWidth = 1;
    self.messageBut.layer.borderColor = rgba(22, 120, 255, 1).CGColor;
    [self.bjview addSubview:self.messageBut];
    
    
    self.weChatBut = [[UIButton alloc]initWithFrame:CGRectMake((APPwidth-82)/2+35, CGRectGetMaxY(self.examinationRoomLabel.frame)+20, (APPwidth-82)/2, 40)];
    [self.weChatBut setTitle:@"微信通知" forState:UIControlStateNormal];
    [self.weChatBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.weChatBut.backgroundColor = rgba(22, 120, 255, 1);
    self.weChatBut.titleLabel.font = kPingFangRegular(14);
    self.weChatBut.layer.cornerRadius = 20;
    self.weChatBut.layer.masksToBounds = YES;
    [self.bjview addSubview:self.weChatBut];
    
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
